package controller.seat;

import service.SeatService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "AddFloorController", value = "/AddFloorController")
public class AddFloorController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String floorName = request.getParameter("floorName");
        new SeatService().addFloor(floorName);

        request.getRequestDispatcher("/ManagerIndexController").forward(request, response);
    }
}
